<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>万达营销流程管理系统</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="js/ie6png.js" ></script>
<script type="text/javascript">
DD_belatedPNG.fix('div,ul,li,a,p,img,body,dl,dt,dd');</script>
<![endif]-->
<script src="../js/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
function aa(pid){
  location.reload();
}; 

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
</script>
<script>
<!--
/*第一种形式 第二种形式 更换显示样式*/
function setTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("con_"+name+"_"+i);
menu.className=i==cursel?"hover":"";
con.style.display=i==cursel?"block":"none";
}
}
//-->

function add(pid){
 	 window.open('../openingreport/add2_1.do?yeshu=1&pid='+pid,'添加开盘房间','alwaysRaised=no,top=100,left=100,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no'); 
	
}


</script>
</head>
<body>
<div class="yboxwidth boxcenter ybox01">
  <div class="ybox09">
       
  
  <form action="../openingreport/add3.do?num=1" method="post" id="f1" name="f1">
	  <input type="hidden" value="${op.pid }" name="pid" />
	  <input type="hidden" value="${op.oname}" name="oname" />
	  <input type="hidden" value="<fmt:formatDate value="${op.begintime }" pattern='yyyy-MM-dd'/>" name="begintime" />
	  <input type="hidden" value="${op.state }" name="state" />
  </form>
  
  <form action="../openingreport/add2.do" method="post" id="f2" name="f2">
  <input type="hidden" value="${op.pid }" name="pid" id="pid" />
  <input type="hidden" value="${op.oname}" name="oname" />
  <input type="hidden" value="<fmt:formatDate value="${op.begintime }" pattern='yyyy-MM-dd'/>" name="begintime" />
  <input type="hidden" value="${op.state }" name="state" />
  <div id="tou" >
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="ybox10td1"><a href="#"><img src="../images/op8_1.gif" width="28" height="54" /></a></td>
        <td><table border="0" cellspacing="0" cellpadding="0">
          <tr valign="top">
            <td class="ybox11td1"></td>
            <td class="ybox11td2"><a href="#">1、填写基本信息</a></td>
            <td class="ybox11td8"></td>
            <td class="ybox11td6"><a href="#">2、选择房间</a></td>
            <td class="ybox11td7"></td>
            <td class="ybox11td2"><a href="#">3、导入价格</a></td>
            <td class="ybox11td3"></td>
            <td class="ybox11td2"><a href="#">4、引入付款方式</a></td>
            <td class="ybox11td3"></td>
            <td class="ybox11td2"><a href="#">5、预览并提交</a></td>
            <td class="ybox11td4"></td>
          </tr>
        </table></td>
        <td class="ybox10td1"><a href="#"><img src="../images/op8_2.gif" width="28" height="54" /></a></td>
      </tr>
    </table>
   </div>  
   
   
  </div>
  <div class="ybox02">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="margb4">
      <tr>
        <td class="ybox03td1"></td>
        <td class="ybox03td2"></td>
        <td class="ybox03td3"></td>
      </tr>
      <tr>
        <td class="ybox03td4"></td>
        <td class="ybox03td5"><div class="ybox05 margb8">
         <div id="tou3">
          <dl>
            <dt> <strong>【注】</strong>只能包含未开过盘的房间，系统将自动过滤。 </dt>
          </dl>
          </div>
          <div id="tou4" style="display: none;">
          <dl>
            <dt><strong>【注】</strong>1、点击"下载价格模板"，填写房间价格。<br />
　　　2、点击"导入价格明细"，导入房间价格。</dt>
          </dl>
          </div>
        </div>
          <div class="ybox07 margb2">
          <div id="tou5">   
      <dl>
      <table border="0" cellspacing="0" cellpadding="0" class="ybox07table">
          
              <tr align="left">
                <td class="ybox07td1"><img src="../images/op4_1.gif" /></td>
                <td><a href="#"  onclick="add(${op.pid })">添加房间</a></td>
                <td class="ybox07td2"><img src="../images/op4_0.gif" /></td>
                <td class="ybox07td1"><img src="../images/op4_2.gif" /></td>
                <td><a href="#" onclick="dele()">移除选中房间</a></td>
                <td class="ybox07td2"><img src="../images/op4_0.gif"  /></td>
                <td class="ybox07td1"><img src="../images/op4_3.gif" /></td>
               <td><a href="#"  onclick="deleAll()">移除所有房间</a></td>
               <td class="ybox07td2"><img src="../images/op4_0.gif" /></td>
              	<td><a href="#" onclick="aa(${op.pid })">刷新</a>(<font color="red">*</font>请及时刷新)</td>
              </tr>
             
             
          </table>
          
           
          
          </dl>
          
           </div>
      
          </div><table width="100%" border="0" cellpadding="0" cellspacing="1" class="ybox06table">
                <tr>
                  <td class="ybox06td01"><input type="checkbox" onclick="selectall()" name="checkbox" id="checkbox" /></td>
                  <td width="30" class="ybox06td01">序号</td>
                  <td class="ybox06td01">项目</td>
                  <td class="ybox06td01">房间</td>
                  <td class="ybox06td01">套内面积</td>
                   <td class="ybox06td01">建筑面积单价</td>
                   <td class="ybox06td01">标准总价</td>
                </tr>
              <c:forEach items="${roomcs }" var="room">
              	 <tr>
                  <td class="ybox06td02wcenter"><input type="checkbox" name="checkbox1" id="checkbox1" value="${room.id }" /></td>
                  <td class="ybox06td02wcenter">${room.id }</td>
                  <td class="ybox06td02wleft">${project.name } </td>
                  <td class="ybox06td02wleft">${room.roomnumber } </td>
                  <td class="ybox06td02wcenter">${room.area} </td>
                  <td class="ybox06td02wcenter">${room.roomprice}</td>
                  <td class="ybox06td02wcenter">${room.roomtotal }</td>
                </tr>
              </c:forEach>
               
              </table>
               <input type="hidden" value="${zongye}" id="zongye" />
            <input type="hidden" value="${num}" id="yeshu" />
          <div class="nums boxcenter black12"><a href="#" onclick="fuf()" class="hovera">首 页</a><a href="#" onclick="f3()">上一页</a><a href="#" onclick="f4()">下一页</a><a onclick="ful()" href="#" class="hovera">尾 页</a>&nbsp;&nbsp;&nbsp;第${num}/${zongye}页&nbsp;&nbsp;&nbsp;共${size}条&nbsp;&nbsp;转到&nbsp;
  <input name="num" id="now" type="text" id="textfield" size="2" value="${num}"/>
  &nbsp;页<a href="#" onclick="fu()">跳 转</a></div></td>
        <td class="ybox03td6"></td>
      </tr>
      <tr>
        <td class="ybox03td7"></td>
        <td class="ybox03td8"></td>
        <td class="ybox03td9"></td>
      </tr>
    </table>
 
   <div id="tou7">
    <table width="380" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="60" align="center"><a href="javascript:history.back()"><img src="../images/botton01.gif" width="95" height="34" /></a></td>
        <td align="center"><a href="javascript:void(document.f1.submit())"><img src="../images/botton02.gif" width="95" height="34" /></a></td>	
      </tr>
    </table>
 </div>  
    </form> 
    
  </div>
</div>
<script>
	function dele(){
		var chk_value =[]; 
		$('input[name="checkbox1"]:checked').each(function(){ 
		chk_value.push($(this).val()); 
		}); 
		
		if(chk_value.length==0){
			alert('你还没有选择任何内容'); 
			return ;
		}
		
		$.ajax({
		    url:"../deleroom.do",
		    type:"post",
		    data:{"ids":chk_value},
		    dataType:"json",
		    traditional:true,
		    success:function(data){
		   		
		   	}
		});
		alert('移除成功！');
		location.reload();

	}
	
	function deleAll(){
		var pid = $("#pid").val();
		$.ajax({
		    url:"../deleroomAll.do",
		    async: false,
		    type:"post",
		    data:{"pid":pid},
		    dataType:"json",
		    traditional:true,
		    success:function(data){	
		   	}
		});
		alert('移除成功！');
		location.reload();

	}


	function fu(){
		var now = $("#now").val();
		var zong = $("#zongye").val();
		if(parseInt(zong)>=parseInt(now)>0){
			document.f2.submit();
		}
		else{
			alert("输入有误");
			var yeshu = $("#yeshu").val();
			document.getElementById('now').value = yeshu;
		}
	}
	
	function fuf(){
		document.getElementById('now').value = 1;
		document.f2.submit();
	}
	
	function ful(){
		document.getElementById('now').value = $("#zongye").val();
		document.f2.submit();
	}
	
	function f3(){
		var now = $("#now").val();
		if(parseInt(now)==1){
			alert("已经是第一页");
		}
		else{
			document.getElementById('now').value = parseInt($("#now").val())-1;
			document.f2.submit();
		}
	}
	
	function f4(){
		var now = $("#now").val();
		var zong = $("#zongye").val();
		if(parseInt(zong)==parseInt(now)){
			alert("已经是最后一页");
		}
		else{
			document.getElementById('now').value = parseInt($("#now").val())+1;
			document.f2.submit();
		}
	}


function selectall() { 
	var tform = document.forms['f2']; 
	for (var i=0;i<tform.length;i++) 
	{ 
	var e = tform.elements[i]; 
	if (e.type == "checkbox") 
	e.checked = !e.checked; 
	}
}



</script>
</body>

</html>



